<template>
  <div class="app-container">
    <img :src="image" alt="" class="image">
  </div>
</template>

<script>
export default {
  data() {
    return {
      image: ''
    }
  },
  mounted() {
    this.$nextTick(() => {
      this.image = window.localStorage.getItem('image')
    })
    window.addEventListener('storage', (e) => {
      // console.log("别的浏览器页签storage发生变化:", e)
      // this.image = e.newValue
      this.image = window.localStorage.getItem('image')
    })
  }
}
</script>

<style lang="scss" scoped>
.app-container {
  width: 100%;
  height: 100%;
}
.image {
  width: 100%;
  height: 100%;
}
</style>
